package com.hq.zb.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.serializer.ToStringSerializer;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 菜单表
 * </p>
 *
 * @author huanghanrui
 * @since 2022-03-08
 */
@Data
@TableName("sys_menu")
public class Menu extends BaseModel<Menu> {

    private static final long serialVersionUID = 1L;

    /**
     * 菜单id
     */
    @TableId(value = "menu_id", type = IdType.AUTO)
    private Integer menuId;
    /**
     * 菜单 名称
     */
    @TableField("menu_name")
    private String menuName;
    /**
     * 页面路径
     */
    @TableField("menu_path")
    private String menuPath;
    /**
     * 父菜单
     */
    @TableField("parent_menu")
    private Integer parentMenu;
    /**
     * 图标
     */
    @TableField("menu_icon")
    private String menuIcon;
    /**
     * 状态
     */
    @TableField("enable_flag")
    private Boolean enableFlag;
    /**
     * 排序
     */
    @TableField("sort_number")
    private Integer sortNumber;

    /**
     * 菜单类型MENU/BUTTON
     */
    @TableField("menu_type")
    private String menuType;

    @TableField(exist = false)
    private List<Menu> children;

    @Override
    protected Serializable pkVal() {
        return this.menuId;
    }
}
